package com.yuntsg.nnsfcp.test.pdf.asposepdf.examples;


import com.yuntsg.nnsfcp.test.pdf.asposepdf.examples.AsposePdfExamples.Annotations.*;
import com.yuntsg.nnsfcp.test.pdf.asposepdf.examples.AsposePdfExamples.Attachments.*;
import com.yuntsg.nnsfcp.test.pdf.asposepdf.examples.AsposePdfExamples.Bookmarks.*;
import com.yuntsg.nnsfcp.test.pdf.asposepdf.examples.AsposePdfExamples.DocumentConversion.*;
import com.yuntsg.nnsfcp.test.pdf.asposepdf.examples.AsposePdfExamples.DocumentObject.AddingJavaScriptDOM;

import java.io.File;

public class Utils {

    private static File dir = null;

    public static void main(String[] args) {

        //run all examples in evaluation mode:

        //AsposePdfExamples.Annotations
        AddAnnotationToPDF.runExamples();
        DeleteAllAnnotationsFromPageOfPDFFile.runExamples();
        DeleteParticularAnnotationFromThePDFFile.runExamples();
        GetAllAnnotationsFromPageInPDF.runExamples();
        GetParticularAnnotationFromPDF.runExamples();
        RedactCertainPageRegionWithRedactionAnnotation.runExamples();
        StrikeOutWordsUsingStrikeOutAnnotation.runExamples();

        //AsposePdfExamples.Attachments
        AddAttachmentToPDF.runExamples();
        DeleteAllAttachmentsFromPDF.runExamples();
        DisableFilesCompressionWhenAddingAsEmbeddedResources.runExamples();
        GetAttachmentInformation.runExamples();
        GetAttachmentsFromPDFDocument.runExamples();

        //AsposePdfExamples.Bookmarks
        AddBookmarkToPDFDocument.runExamples();
        AddChildBookmarkToPDFDocument.runExamples();
        BookmarkShouldPointToStartOfPage.runExamples();
        DeleteBookmarksFromPDFDocument.runExamples();
        ExpandedBookmarksWhenViewingDocument.runExamples();
        GetBookmarksFromPDFDocument.runExamples();
        UpdateBookmarksInPDFDocument.runExamples();

        //DocumentConversion
        ConvertEPUBFileToPDFFormat.runExamples();
        ConvertHTMLToPDFFormat.runExamples();
        ConvertPCLToPDFFormat.runExamples();
        ConvertPDFFileIntoXPSFormat.runExamples();
        ConvertPDFToDOCOrDOCXFormat.runExamples();
        ConvertPDFToEPUBFormat.runExamples();
        ConvertPDFToExcelWorkbook.runExamples();
        ConvertPDFToPDFAFormat.runExamples();
        ConvertPDFToSVGFormat.runExamples();
        ConvertPDFToXML.runExamples();
        ConvertSVGFileToPDFFormat.runExamples();
        ConvertXMLFileToPDF.runExamples();
        ConvertXSLFOToPDF.runExamples();
        CreatePDFwithTaggedText.runExamples();
        PDFToEMF.runExamples();
        PDFToHTMLAvoidSavingImagesInSVGFormat.runExamples();
        PDFToHTMLGetWarningForFontSubstitution.runExamples();
        PDFToHTMLSingleHTMLWithAllResourcesEmbedded.runExamples();
        PDFToHTMLSplittingOutputToMultipageHTML.runExamples();
        ValidatePDFUAStandards.runExamples();

        //DocumentObject
        AddingJavaScriptDOM.runExamples();


    }

    public static String getDataDir(String testID) {
        return getSharedDataDir() + testID;
    }

    public static String getOutDir(String testID) {
        return getSharedDataDir() + "../../../testout/" + testID;
    }

    public static String getSharedDataDir() {
        if (dir == null) {
            dir = new File(dir, "src/main/resources/");
        }

        return dir.toString() + File.separator;
    }
}
